package com.cloudfun.campusshare.common.constant;

/**
 * @author : zhangyongjie
 * @version : 1.0
 * @createTime : 2020/5/11 11:44
 * @description : 报修单处理结果
 */
public enum RepireResult {
    ALREADY_RESOLVE(1,"故障已修复"),
    NO_TROUBLE(2,"无故障"),
    EXCEPTION(3,"异常");

    private int code;
    private String message;

    RepireResult(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public static RepireResult getByCode(Integer code){
        RepireResult[] values = RepireResult.values();
        for(RepireResult repireResult:values){
            if(repireResult.code == code.intValue()){
                return repireResult;
            }
        }
        return null;
    }
}
